package com.book.oauth.server.login.log.hystrix.impl;

import com.book.common.api.impl.BaseHystrixImpl;
import com.book.oauth.server.login.log.dto.LoginLogDto;
import com.book.oauth.server.login.log.vo.LoginLogVo;
import com.book.oauth.server.login.log.hystrix.ILoginLogHystrix;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * Description：登录日志 HystrixImpl
 * @Author： leo.xiong
 * @CreateDate： 2020-05-26
 * @Email： leo.xiong@suyun360.com
 * Version: 
 */
@Slf4j
@Component
public class LoginLogHystrixImpl extends BaseHystrixImpl<LoginLogDto, LoginLogVo> implements FallbackFactory<ILoginLogHystrix>, ILoginLogHystrix {

    @Override
    public ILoginLogHystrix create(Throwable e) {
        log.error("oauth-server.LoginLogHystrixImpl.登录日志服务调用失败:{}", e.getMessage());
        e.printStackTrace();
        return new LoginLogHystrixImpl();
    }
}
